<%@page import="java.util.Date"%>
<%@page import="com.crm.entity.Executives,java.text.DateFormat,java.text.SimpleDateFormat" %>
	<form id="form1" name="form1" method="post" action="<%=application.getContextPath() %>/executives/editSave.do">

    <div id="work-area2">
    
      <div class="heading">Edit Executives</div>
	  <%
	  Executives ex=(Executives)request.getAttribute("executive");
	  %>
      <div class="boxIFS">
        
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="left">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
            </tr>
            <tr>
            <input type="hidden" name="id" value="<%=ex.getId()%>"/>
              <td width="19%" align="left">Executive Name</td>
              <td width="30%" align="left" valign="middle">
              <label></label>          
                 <input name="execname" type="text" class="form" id="execNameId" value="<%=ex.getExeName()%>"/>
                 </td>   
              <td width="1%" align="left" valign="middle">&nbsp;</td>
              <td width="15%" align="left" valign="middle">&nbsp;</td>
            </tr>
            <tr>
              <td height="5" align="right"></td>
              <td height="5" align="right" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
             <tr>
              <td align="left">Blood Group</td>
              <td align="left" valign="middle"><label>
               <select class="form" name="bloodGroup" id="BloodGroupId">
               <option>AB+</option>
               <option>AB-</option>
               <option>B+</option>
               <option>B-</option>
               <option>O+</option>
               <option>O-</option>
               </select>
                </label>              </td>
              <td align="left" valign="top">Gender</td>
              <td align="left" valign="top">
             <input type="radio" name="gender" <%if(ex.getGender().equals("Male") || ex.getGender().equals("male")){%> checked <%} %> value="Male"/>Male</td>
              <td align="left" valign="middle"><input type="radio" name="gender" value="Male"/>Female</td>
            </tr>
            <tr>
              <td height="5" align="right"></td>
              <td height="5" align="right" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
            <tr>
              <td align="left">Email</td>
              <td align="left" valign="middle"><label>
                <input name="email" type="text"  class="form-lowercase" id="emailid" value="<%=ex.getEmailId()%>"/>
                </label>              </td>
              <td align="left" valign="middle">Fax</td>
              <td align="left" valign="middle"><label>
                <input name="fax" type="text" class="form" id="faxid" value="<%=ex.getFax()%>"/>
                </label>              </td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
            </tr>
            <tr>
              <td height="5" align="right"></td>
              <td height="5" align="right" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
            <tr>
              <td align="left">DOB</td>
              <td align="left" valign="middle"><label>
              <%
              String ddate="";
              Date dob=ex.getDob();
              DateFormat dfmt=new SimpleDateFormat("dd-MM-yyyy");
            	ddate=dfmt.format(dob.getTime());
              
      		System.out.println("DOB In JSP Is"+ex.getDob());
              %>
                <input name="dob" type="text" class="form" id="dobID" value="<%=ddate%>"/>
                </label>              </td>
              <td align="left" valign="middle">Joining Date</td>
              <%
              String djdate="";
              Date jdob=ex.getJoiningDate();
              DateFormat jdfmt=new SimpleDateFormat("dd-MM-yyyy");
            	djdate=jdfmt.format(jdob.getTime());
              
      		
              %>
              <td align="left" valign="middle"><label>
                <input name="joiningDate" type="text" class="form" id="joinDateId" value="<%=djdate%>"/>
                </label>              </td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
            </tr>
            <tr>
              <td height="5" align="right"></td>
              <td height="5" align="right" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
            <tr>
              <td align="left">Phone Number</td>
              <td align="left" valign="middle"><label>
                <input name="phone" type="text" class="form" id="phoneid" value="<%=ex.getPhone()%>"/>
                </label>              </td>
              <td align="left" valign="top">Cell</td>
              <td align="left" valign="top">
              <%
              String cell="";
              if(ex.getCell()!=null){
            	  cell=ex.getCell();
              }
              %>
              <input name="cell" type="text" class="form" id="cellid" value="<%=cell%>"/></td>
              <td align="left" valign="middle">&nbsp;</td>
            </tr>
            <tr>
              <td height="5" align="right"></td>
              <td height="5" align="right" valign="top"></td>
              <td height="5" align="left" valign="middle"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
              <td height="5" align="left" valign="top"></td>
            </tr>
            <tr>
              <td align="left">Address</td>
               <%
              String addr="";
              if(ex.getAddress()!=null){
            	  addr=ex.getAddress();
              }
              %>
              <td align="left" valign="top">
              <textarea name="address" class="form-textarea" id="addressid"><%=addr%></textarea></td>
              <% System.out.println("Address Is:"+ex.getAddress()); %>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
            </tr>
            <tr>
              <td align="left">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
            </tr>
            <tr>
              <td colspan="2" align="left" valign="middle"></td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
            </tr>
          </table>
     
      </div>
	  
	  <div class="box2"></div>
	  <div class="box2">
	    <div class="buttton-main">
	    <div class="button"><a href="<%=application.getContextPath()%>/executives/show.do">Add</a></div>
	    <input type="reset" value="Clear" class="button"/>
	  <!--   <div class="button"><a href="#">Delete</a></div> -->
	    <div class="button"><a href="<%=application.getContextPath()%>/executives/edit.do">Edit</a></div>
	     <input type="submit" class="button" value="Save" onclick="javascript:return validate();"/>
	    </div>
	  </div>
	  
    </div>

    </form>
    <script>

	$(function() {
		$( "#dobID" ).datepicker({ dateFormat: "dd-mm-yy" },"option", "autoSize", true);
		$( "#joinDateId" ).datepicker({ dateFormat: "dd-mm-yy" },"option", "autoSize", true);
	});
	</script>